import Vue from 'vue'
import VueRouter from 'vue-router'


Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    redirect: '/home/index/remmend'
  },
  {
    path: '/home',
    name: 'home',
    component: () => import(/* webpackChunkName: "home" */ '@/views/home'),
    children: [{
      path: '/home',
      redirect: '/home/index/remmend'
    },{
      path: '/home/hot',
      name: 'hot',
      component: () =>import(/* webpackChunkName: "hot" */'@/views/home/hot')
    },{
      path: '/home/login',
      name: 'login',
      component: () =>import(/* webpackChunkName: "login" */'@/views/home/login')
    },{
      path: '/home/post/:id',
      name: 'post',
      component: () =>import(/* webpackChunkName: "post" */'@/views/home/post')
    },{
      path: '/home/index',
      name: 'index',
      component: () =>import(/* webpackChunkName: "index" */'@/views/home/index/index.vue'),
      children: [{
        path: '/home/index',
        redirect: '/home/index/remmend'
      },{
        path: '/home/index/remmend',
        name: 'remmend',
        component: () =>import(/* webpackChunkName: "remmend" */'@/views/home/index/remmend'),
      },{
        path: '/home/index/andr',
        name: 'andr',
        component: () =>import(/* webpackChunkName: "andr" */'@/views/home/index/andr'),
      },{
        path: '/home/index/web',
        name: 'web',
        component: () =>import(/* webpackChunkName: "web" */'@/views/home/index/web'),
      },{
        path: '/home/index/ios-apple',
        name: 'ios-apple',
        component: () =>import(/* webpackChunkName: "ios-apple" */'@/views/home/index/ios-apple'),
      }]
    },{
      path: '/home/mess',
      name: 'mess',
      component: () =>import(/* webpackChunkName: "mess" */'@/views/home/mess')
    }]
  },
  {
    path: '*',
    name: 'notMatch',
    component: () => import('@/views/404')
  }
]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
